import React from "react";
import ReactDOM from "react-dom/client";
import App from "./pages/App";
import TableList from "./pages/TableList";
import TableEdit from "./pages/TableEdit";
import "./style.css";
import { createHashRouter, RouterProvider } from "react-router-dom";

const router = createHashRouter([
  {
    path: "/",
    element: <App />,
    children: [
      {
        path: "/database/:name/table/list",
        element: <TableList />,
      },
      {
        path: "/database/:name/table/form/:action",
        element: <TableEdit />,
      },
    ],
  },
]);

ReactDOM.createRoot(document.getElementById("app") as Element).render(
  <React.StrictMode>
    <RouterProvider router={router} />
  </React.StrictMode>
);
